<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的培训老师</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="../css/aui.2.0.css">
    <link rel="stylesheet" href="../css/reset.css">
       <link rel="stylesheet" href="../css/alert.css">
    <link rel="stylesheet" href="../css/common1.css">
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/lessstyle.css">
</head>
<body>
<header class="aui-bar aui-bar-nav" id="aui-header">
    <div class="aui-col-xs-3 my-col-xs-3">
        <i class="aui-iconfont aui-icon-left"></i>
    </div>
    <div class="aui-title my-aui-title">我的培训老师</div>
</header>
<nav>
    <div class="member-info-entry" id="member-info-entry">
            <script type="text/x-handlebars-template" id="teacher-template">
                {{#this}}
                {{#valueCompare this '!==' ''}}
                <ul class="member-info-list teacher-info-list">
                    <li>
                        <a href="othersshop.html?userId={{id}}" class="display-box">
                            <span>{{userNickName}}</span>
                            <span>他的店铺</span>
                        </a>
                    </li>
                </ul>
                {{/valueCompare}}
                {{#valueCompare this.length '===' 0 }}
                <ul class="member-info-list teacher-info-list">
                    <li class="no-teacher">暂无培训老师.....</li>
                </ul>

                {{/valueCompare}}
                {{/this}}
            </script>
    </div>
</nav>
<script src="../js/jquery-3.0.0.min.js"></script>
<script src="../js/config.js"></script>
<script src="../js/common.js"></script>
<script src="../js/function.js"></script>
<script src="../js/alert.js"></script>
<script src="../js/handlebars-v4.0.10.js"></script>
<script>
    var a=$('#teacher-template').html();
    var b=Handlebars.compile(a);
    $.ajax({
        url:C.marketInterface.myTeacher,
        type:'GET',
        dataType:'json',
        data:{
            token:C.marketToken
        },
        success:function (data) {
            if(data.result=='success'){
                var data=data.data;
                console.log(data);
                $('.member-info-entry').html(b(data));
            }else if(data.result=='login'){
            	dialog.tusiError('登入过期，请重新登入！');
                againLogin();
            }else {
            	dialog.tusiError(data.errorMsg);
            }
        }
    })
</script>
</body>
</html>